package com.wxl.common.adapter

import android.text.TextUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.wxl.common.R
import com.wxl.common.util.ImgLoader

/**
 * create file time : 2021/3/19
 * create user : wxl
 * subscribe :
 */
class GridImageAdapter : BaseQuickAdapter<String,BaseViewHolder>{

    constructor(data: MutableList<String>?) : super(R.layout.item_grid_image_layoout,data)


    override fun convert(helper: BaseViewHolder, item: String?) {
        if(item != null && !TextUtils.equals("space",item)){
            helper.setGone(R.id.gridImageItemEmptyLayout,false)
            helper.setGone(R.id.gridImageItemImg,true)
            ImgLoader.file(helper.getView(R.id.gridImageItemImg),item)
        } else {
            helper.setGone(R.id.gridImageItemEmptyLayout,true)
            helper.setGone(R.id.gridImageItemImg,false)
        }
    }

}